function dock(id){ this.speed = 10; this.pace = 10; this.min = 40; this.max = 80; var img, sizes = []; if(typeof(id) != 'string'){ id = 'dock'; } this.init = function(){ var self = this; this.dock = $(id); sizes.def = Math.floor((this.max-this.min)/3); for(i=0; i<4; i++){ sizes[i] = 1*this.min + i*sizes.def; } //Get the images img = this.dock.getElementsByTagName('img'); //Set the width this.dock.style.height = sizes[3]+"px"; //Set the height this.dock.style.width = (sizes[0]*(img.length-1))+"px"; for (i=0; i-1 && m 2 ? 2 : m; if(n > -1){ img[0].target.left = -(1/2)*(sizes[0]+ sizes.def *(n*(4-(1/2)*n)+3)); }else{ img[0].target.left = 0; } for(i=1; i